<%@page import="org.apache.jasper.tagplugins.jstl.core.ForEach"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@page import="objetos.EstatisticaBean"%>
<%@page import="objetos.Estatistica"%>
<%@page import="java.util.Iterator"%>
<%@page import="java.util.ArrayList"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Jogo da Forca - Estatisticas</title>
<script>
function voltar(paramAcao) {
				document.frmEstat.action="<%=request.getContextPath()%>/ForcaServlet?acao="+ paramAcao;
		document.frmEstat.submit();
	}
</script>
</head>
<body>
	<h1>ESTATISTICAS DO JOGO DA FORCA</h1>

	<table border="1">
		<tr>
			<th>Jogador</th>
			<th>Nivel</th>
			<th>Palavra</th>
			<th>Status</th>
			<th>Historico</th>
			<th>Chances</th>
			<th>Acertos</th>
			<th>Erros</th>
			<th>Dicas</th>
		</tr>
		<%
			Estatistica estat = new Estatistica();
			ArrayList<EstatisticaBean> list = estat.getEstatisticas();

			for (EstatisticaBean bean : list) {
		%>
		<tr>
			<td><%=bean.getNome()%></td>
			<td><%=bean.getNivel()%></td>
			<td><%=bean.getPalavras()%></td>
			<td><%=bean.getStatus()%></td>
			<td><%=bean.getHist()%></td>
			<td><%=bean.getChances()%></td>
			<td><%=bean.getAcertos()%></td>
			<td><%=bean.getErros()%></td>
			<td><%=bean.getDic()%></td>
		</tr>
		<%
			}
		%>
	</table>

	<br />
	<br />

	<form id="frmEstat" name="frmEstat" method="post" action="">

		<input type="button" value="Voltar"
			onClick="javascript:voltar('voltarPrincipal')" />

	</form>
	<script>
	function voltar(paramAcao) {
				document.frmEstat.action="<%=request.getContextPath()%>/ForcaServlet?acao="+ paramAcao;
		document.frmEstat.submit();
	}
</script>
</body>
</html>